import BaseService from './_BaseService'
import axios from 'axios'
import config from '../config'

class TaskObjectService extends BaseService {
  statistics (entity) {
    return axios.post(config.SERVER_URL + window.apiPath + '/tasks/statistics', {...entity, responseType: 'json'})
      .then(resp => resp)
  }

  productPie () {
    return axios.get(config.SERVER_URL + window.apiPath + '/productLinePieStatistics', {responseType: 'json'})
      .then(resp => resp)
  }
  // 进出港船舶
  RptVoyShip (query) {
    return axios.get(config.SERVER_URL + window.apiPath + '/productLineRptVoyShipStatistics?' + query, {responseType: 'json'})
      .then(resp => resp)
  }
  // 旅客到达发送量趋势
  RptVoyPass (query) {
    return axios.get(config.SERVER_URL + window.apiPath + '/productLineRptVoyPassStatistics?' + query, {responseType: 'json'})
      .then(resp => resp)
  }
  // 货物运输趋势
  Good (query) {
    return axios.get(config.SERVER_URL + window.apiPath + '/productLineGoodStatistics?' + query, {responseType: 'json'})
      .then(resp => resp)
  }
  // 危险品
  DangerGoods (query) {
    return axios.get(config.SERVER_URL + window.apiPath + '/productLineDangerGoodsShipStatistics?' + query, {responseType: 'json'})
      .then(resp => resp)
  }

  // 标记点
  getLocal () {
    return axios.get(config.SERVER_URL + window.apiPath + '/marineCoordinate', {responseType: 'json'})
      .then(resp => resp)
  }
}

export default new TaskObjectService()
